fn main() {
    println!("Hello, world!");
}

struct Screen {
    components: Vec<Box<dyn Draw>>,
}

impl Screen {
    fn run(&self) {
        self.components.iter().for_each(|c| c.draw());
    }
}

pub trait Draw {
    fn draw(&self);
}

struct Button {}

struct Window {}

struct TextBox {}

impl Draw for Button {
    fn draw(&self) {
        println!("Button");
    }
}

impl Draw for Window {
    fn draw(&self) {
        println!("Window");
    }
}

impl Draw for TextBox {
    fn draw(&self) {
        println!("TextBox");
    }
}

#[allow(unused)]
fn build_ui(sc: &mut Screen) {
    let b = Box::new(Button {});
    let w = Box::new(Window {});
}
